package com.ly.web.controller.erp;

import java.util.List;

import com.ly.heart.service.IKingFinancePayDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ly.common.annotation.Log;
import com.ly.common.core.controller.BaseController;
import com.ly.common.core.domain.AjaxResult;
import com.ly.common.enums.BusinessType;
import com.ly.heart.domain.KingFinancePayDetailEntity;
import com.ly.common.utils.poi.ExcelUtil;
import com.ly.common.core.page.TableDataInfo;

import javax.annotation.Resource;

/**
 * 财务模块-付款、收款、付款退款、收款退款，明细列Controller
 *
 * @author wutao
 * @date 2024-07-12
 */
@Api ( value = "KingFinancePayReceiptDetail", tags = "财务模块-付款、收款、付款退款、收款退款，明细列" )
@RestController
@RequestMapping ( "/heart/KingFinancePayReceiptDetail" )
public class KingFinancePayDetailController extends BaseController {

    @Resource
    private IKingFinancePayDetailService kingFinancePayReceiptDetailEntityService;

    /**
     * 查询财务模块-付款、收款、付款退款、收款退款，明细列列表
     */
    @PreAuthorize ( "@ss.hasPermi('heart:KingFinancePayReceiptDetail:list')" )
    @GetMapping ( "/list" )
    @ApiOperation ( "查询财务模块-付款、收款、付款退款、收款退款，明细列列表" )
    public TableDataInfo list ( KingFinancePayDetailEntity kingFinancePayDetailEntity ) {
        startPage ();
        List<KingFinancePayDetailEntity> list = kingFinancePayReceiptDetailEntityService.selectKingFinancePayReceiptDetailEntityList ( kingFinancePayDetailEntity );
        return getDataTable ( list );
    }

    /**
     * 导出财务模块-付款、收款、付款退款、收款退款，明细列列表
     */
    @PreAuthorize ( "@ss.hasPermi('heart:KingFinancePayReceiptDetail:export')" )
    @Log ( title = "财务模块-付款、收款、付款退款、收款退款，明细列", businessType = BusinessType.EXPORT )
    @GetMapping ( "/export" )
    @ApiOperation ( "导出财务模块-付款、收款、付款退款、收款退款，明细列列表" )
    public AjaxResult export ( KingFinancePayDetailEntity kingFinancePayDetailEntity ) {
        List<KingFinancePayDetailEntity> list = kingFinancePayReceiptDetailEntityService.selectKingFinancePayReceiptDetailEntityList ( kingFinancePayDetailEntity );
        ExcelUtil<KingFinancePayDetailEntity> util = new ExcelUtil<KingFinancePayDetailEntity> ( KingFinancePayDetailEntity.class );
        return util.exportExcel ( list, "info" );
    }

    /**
     * 新增财务模块-付款、收款、付款退款、收款退款，明细列
     */
    @PreAuthorize ( "@ss.hasPermi('heart:KingFinancePayReceiptDetail:add')" )
    @Log ( title = "财务模块-付款、收款、付款退款、收款退款，明细列", businessType = BusinessType.INSERT )
    @PostMapping
    @ApiOperation ( "新增财务模块-付款、收款、付款退款、收款退款，明细列" )
    public AjaxResult add ( @RequestBody KingFinancePayDetailEntity kingFinancePayDetailEntity ) {
        return ( kingFinancePayReceiptDetailEntityService.insertKingFinancePayReceiptDetailEntity ( kingFinancePayDetailEntity ) );
    }

}
